<%-- Copyright (C) 2009 WorkSmart Labs, Inc. --%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%-- 
    This is a simple JSP template for creating a challenge. It lets you input a name
    for the challenge, an id that will be part of the URL and a small description.  
    @author mark
--%>


<html>
  <head>
    <title>WALK2.me</title>
    <link rel="stylesheet" href="/static/style.css" type="text/css" media="all"/>
  <%
    String challengeName = (String) request.getAttribute("challengeName");
    String challengeId = (String) request.getAttribute("challengeId");
    String signedInUserEmail = (String) request.getAttribute("signedInUserEmail");
    String signInUrl = (String) request.getAttribute("signInUrl");
    String signOutUrl = (String) request.getAttribute("signOutUrl");
  %>
  </head>
  <body>
    <div class="title">WALK2.me</div>
    <div class="signin">
      <% if (signedInUserEmail == null) { %>
        <a href="<%=signInUrl %>">Sign In</a>
      <% } else { %>
        <b><%=signedInUserEmail %></b>&nbsp;<a href="<%=signOutUrl %>">Sign Out</a>
      <% } %>
   	</div>
    <br/>
    <div class="subtitle">Get your friends, family, and co-workers walking!</div><br/>
    <div class="normal">Walking 30 minutes a day is <i>proven</i> to cause weight loss and 
      prevent heart attacks. Create a free challenge for any group of people below or <u>view 
      example results</u>.<br/><br/>
    <form action="" method="get">
      <div class="slim-heading">1.  Enter Challenge Details</div>
      <div class="slim">
        <table>
        <tr><td style="width: 250px;">Challenge name:</td>
            <td><input type="text" name="name" value="<%=challengeName%>"/></td>
        </tr>
        <tr><td>Contest id: <i>http://www.walk2.me/</i></td>
            <td><input type="text" name="id" value="<%=challengeId%>" /></td>
        </tr>
        <tr><td>More info link (optional): </td>
             <td><input type="text" name="more_info_url"/></td>
        </tr>
        </table>
      </div>
      <div class="slim-heading">2. Create Challenge with your Google account.</div>
      <div class="slim">Note: Walk2.me does not work with corporate Google Apps accounts, so <b>please use your personal @gmail.com or @googlemail.com email address</b>.
      </div>
      <div class="slim">
        <input class="create-button" type="submit" value="Create Challenge"/>
      </div>
    </form>
  </body>
</html>